home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3dm / dmedia / dmG726Encode.z / dmG726Encode
Encoding:
Text File  |  1998-10-20  |  7.4 KB  |  133 lines

  1.  
  2.  
  3.  
  4. ddddmmmmGGGG777722226666EEEEnnnnccccooooddddeeee((((3333ddddmmmm))))                                            ddddmmmmGGGG777722226666EEEEnnnnccccooooddddeeee((((3333ddddmmmm))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      dmG726Encode - implements ITU (International Telecommunication Union)
  10.      Recommendation G.726 ADPCM compression for input of 64 kbit/s A-law, mu-
  11.      law, or linear data and output of compressed bit stream of 40, 32 ,24, or
  12.      16 kbit/s.  G.726 replaced G.721 and G.723.
  13.  
  14.  
  15. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  16.      ####iiiinnnncccclllluuuuddddeeee <<<<ddddmmmmeeeeddddiiiiaaaa////ddddmmmm____aaaauuuuddddiiiioooouuuuttttiiiillll....hhhh>>>>
  17.  
  18.      DDDDMMMMssssttttaaaattttuuuussss ddddmmmmGGGG777722226666EEEEnnnnccccooooddddeeee((((DDDDMMMMGGGG777722226666eeeennnnccccooooddddeeeerrrr hhhhaaaannnnddddlllleeee,,,,
  19.                            vvvvooooiiiidddd ****iiiibbbbuuuuffff,,,,
  20.                       uuuunnnnssssiiiiggggnnnneeeedddd cccchhhhaaaarrrr ****oooobbbbuuuuffff
  21.                            iiiinnnntttt nnnnuuuummmmSSSSaaaammmmpppplllleeeessss))))
  22.  
  23.  
  24. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRR
  25.      _h_a_n_d_l_e    DDDDMMMMGGGG777722226666eeeennnnccccooooddddeeeerrrr structure, created by ddddmmmmGGGG777722226666EEEEnnnnccccooooddddeeeerrrrCCCCrrrreeeeaaaatttteeee((((3333ddddmmmm)))),
  26.                specifies the signal processing parameters.
  27.  
  28.  
  29.      _i_b_u_f      pointer to input sample data buffer, an array of short (16
  30.                bits) for linear input or unsigned char for A-law or mu-law
  31.                input.  For linear input, samples are assumed to be two's
  32.                complement.  Data buffer must be a multiple (the same multiple
  33.                as that of output bitstrem buffer) of 4, 8, 2, or 8 for
  34.                operations at 16, 24, 32, or 40 kbit/s respectively.  This
  35.                assumes the sampling rate of 8 kHz.
  36.  
  37.  
  38.      _o_b_u_f      pointer to output compressed data buffer, an array of bytes.
  39.                The data format is unsigned char (8-bit).  The output bitstrem
  40.                buffer consists of a multiple of 1, 3, 1, or 5 bytes, for
  41.                operations at 16, 24, 32, or 40 kbit/s respectively.
  42.  
  43.  
  44.      _n_u_m_S_a_m_p_l_e_s
  45.                number of samples to be processed. it must always be a multiple
  46.                of 4, 8, 2, or 8 for operations at 16, 24, 32, or 40 kbit/s
  47.                respectively.
  48.  
  49.  
  50. RRRREEEETTTTUUUURRRRNNNNEEEEDDDD VVVVAAAALLLLUUUUEEEE
  51.      Returns DDDDMMMM____FFFFAAAAIIIILLLLUUUURRRREEEE or DDDDMMMM____SSSSUUUUCCCCCCCCEEEESSSSSSSS.
  52.  
  53.  
  54. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  55.      ddddmmmmGGGG777722226666EEEEnnnnccccooooddddeeee((((3333ddddmmmm)))) implements ITU G726 compression.  G.726 compression
  56.      compresses one input sample to 2, 3, 4, or 5 bits for 16, 24, 32, or 40
  57.      kbit/s operations respectively. 16, 24, 32, or 40 kbit/s operation is
  58.      indicated by setting parameter DDDDMMMM____AAAAUUUUDDDDIIIIOOOO____BBBBIIIITTTTRRRRAAAATTTTEEEE to DDDDMMMM____GGGG777722226666____11116666____KKKKBBBBIIIITTTTSSSS,
  59.      DDDDMMMM____GGGG777722226666____22224444____KKKKBBBBIIIITTTTSSSS, DDDDMMMM____GGGG777722226666____33332222____KKKKBBBBIIIITTTTSSSS, or DDDDMMMM____GGGG777722226666____44440000____KKKKBBBBIIIITTTTSSSS using DMparams
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ddddmmmmGGGG777722226666EEEEnnnnccccooooddddeeee((((3333ddddmmmm))))                                            ddddmmmmGGGG777722226666EEEEnnnnccccooooddddeeee((((3333ddddmmmm))))
  71.  
  72.  
  73.  
  74.      and passed to ddddmmmmGGGG777722226666EEEEnnnnccccooooddddeeeerrrrSSSSeeeettttPPPPaaaarrrraaaammmmssss((((3333ddddmmmm)))).  Input format is indicated by
  75.      setting DDDDMMMM____GGGG777722226666____NNNNAAAATTTTIIIIVVVVEEEE____FFFFOOOORRRRMMMMAAAATTTT to DDDDMMMM____GGGG777722226666____UUUULLLLAAAAWWWW, DDDDMMMM____GGGG777722226666____AAAALLLLAAAAWWWW, or
  76.      DDDDMMMM____GGGG777722226666____LLLLIIIINNNNEEEEAAAARRRR____PPPPCCCCMMMM, respectively for inputting of mu-law, A-law, or
  77.      linear PCM data, using DMparams and passed to
  78.      ddddmmmmGGGG777722226666EEEEnnnnccccooooddddeeeerrrrSSSSeeeettttPPPPaaaarrrraaaammmmssss((((3333ddddmmmm)))).  If input format is DDDDMMMM____GGGG777722226666____LLLLIIIINNNNEEEEAAAARRRR____PPPPCCCCMMMM, the
  79.      PCM data type will be short.  Otherwise, the PCM data type will be
  80.      unsigned char.  Therefore, the inbuf is void in the function prototyping.
  81.  
  82.  
  83.      G726 compression uses a linear prediction scheme.  This means that the
  84.      compressed bits, which carrying compressed information, are interrelated
  85.      or interdependent.  If a application calls aaaaffffSSSSeeeeeeeekkkkFFFFrrrraaaammmmeeee(3dm) to an offset
  86.      into the compressed bit stream file and then starts reading bits in the
  87.      middle of the bit stream and decompress them with ddddmmmmGGGG777722226666DDDDeeeeccccooooddddeeee(3dm), the
  88.      interdependency of the bits at the cutting point is lost.  The
  89.      application will initially get back data with a lower amplitude than if
  90.      he had read the same data back during a complete pass over the file from
  91.      the beginning.
  92.  
  93.  
  94.      There is no way to exactly recreate the decoded data in the middle of the
  95.      bit stream file without going all the way back to the beginning.
  96.      However, with a "preroll" value to read ahead a portion of the compressed
  97.      file, application can compensate for the amplitude problem.
  98.  
  99.  
  100. NNNNOOOOTTTTEEEE
  101.      G.726 algorithm was developed for sampling rate of 8 kHz, but could be
  102.      used from 8 kHz to 48 kHz.
  103.  
  104.  
  105. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  106.      dmG726EncoderCreate(3dm), dmG726EncoderSetParams(3dm),
  107.      dmG726EncoderDestroy(3dm), dmG726Decode(3dm), ITU (International
  108.      Telecommunication Union) Recommendation G.726.
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.